package demo3;

class Person {
    public int data1 = 100;
    private int data2 = 200;
    public static int data3 = 300;

    public void fun () {
        class Student {
            public int c = 100;
            //可以使用Person类的全部成员变量
            public void print () {
                System.out.println(data1);
                System.out.println(data2);
                System.out.println(data3);
            }
        }
        Student student = new Student();
        student.print();
    }
}

public class Test {
    public static void main(String[] args) {
        Person person = new Person();
        person.fun();
    }
}
